//
// Created by heming on 4/27/20.
//

#ifndef TRY_HYPERSCAN_CLOCK_H
#define TRY_HYPERSCAN_CLOCK_H

#include <chrono>

// Simple timing class
class Clock {
public:
    void start() {
        time_start = std::chrono::system_clock::now();
    }

    void stop() {
        time_end = std::chrono::system_clock::now();
    }

    double seconds() const {
        std::chrono::duration<double> delta = time_end - time_start;
        return delta.count();
    }
private:
    std::chrono::time_point<std::chrono::system_clock> time_start, time_end;
};

#endif //TRY_HYPERSCAN_CLOCK_H
